' PicBasic Pro program to blink all the LEDs connected to PORTD

' Define LOADER_USED to allow use of the boot loader.
' This will not affect normal program operation.
Define	LOADER_USED	1

i       var     byte    ' Define loop variable

LEDS    var     PORTD   ' Alias PORTD to LEDS


TRISD = %00000000       ' Set PORTD to all output

loop:   LEDS = 1        ' First LED on
        Pause 500       ' Delay for .5 seconds

        For i = 1 to 7  ' Go through For..Next loop 7 times

                LEDS = LEDS << 1        ' Shift on LED one to left
                Pause 500       ' Delay for .5 seconds

        Next i

        Goto loop       ' Go back to loop and blink LED forever
        End
